package com.education.service.trade.feign;

import com.education.dto.CourseDto;
import com.education.result.R;
import com.education.service.trade.feign.fallback.EduCourseServiceFallBack;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 模拟远程调用 - 根据课程ID查询课程信息
 * Created by Lance on 2020/07/09 16:46
 */
@Service
@FeignClient(value = "online-education-service-edu", fallback = EduCourseServiceFallBack.class)
public interface EduCourseService {

    /**
     * 根据课程ID查询课程信息 - [ 远程接口 ]
     * @param courseId
     * @return
     */
    @GetMapping("/web/edu/course/get-course-dto/{courseId}")
    public R getCourseDtoById(@PathVariable(value = "courseId") String courseId);

    /**
     * 根据课程id更改销售量
     * @param id
     * @return
     */
    @GetMapping("/web/edu/course/update-buy-count/{id}")
    R updateBuyCountById(@PathVariable("id") String id);
}
